import React, {Component} from 'react';
import {hot} from 'react-hot-loader/root';
import {connect} from 'dva';
import {Table} from 'antd';

@connect(({global, tables}) => ({
    global,
    tableSources: tables.tableSources,
    tableColumns: tables.tableColumns
}))
class RouteForms extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }
    render() {
        const {tableSources, tableColumns} = this.props;
        let newTableSources = [];
        tableSources.map((item, index) => {
            newTableSources.push({...item, key: index});
            return false;
        });
        return (
            <section>
                <Table bordered dataSource={newTableSources} columns={tableColumns} />
            </section>
        );
    }
}

export default hot(RouteForms);
